package com.cooldatasoft.support.git;

import java.util.List;

/**
 * User: brano
 */
class DirectoryNode extends AbstractFileNode {
    private List<FileNodeInterface> children;

    public DirectoryNode(long lastModified, List<FileNodeInterface> children, String fileName) {
        super(lastModified, fileName);
        this.children = children;
    }

    @Override
    public boolean isDirectory() {
        return true;
    }

    @Override
    public List<FileNodeInterface> getChildren() {
        return children;
    }

    @Override
    public String getFullInfo() {
        StringBuilder sb = new StringBuilder();
        sb.append(super.getFullInfo());
        for (FileNodeInterface child : children) {
            sb.append(child.getFullInfo());
        }
        return sb.toString();
    }
    
    @Override
    public float getSize() {
        return -1;
    }
}
